<%-- 
    Document   : Employee
    Created on : May 9, 2012, 9:28:43 AM
    Author     : Nguyen Hung
--%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>
<html>
    <head>
          <link rel="stylesheet" type="text/css" href="../css/popup.css"/>
        <link rel="stylesheet" type="text/css" href="../css/kapiform.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/kapi.js"></script>
        <link rel="stylesheet" type="text/css" href="../css/thickbox.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/thickbox.js"></script>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jquery.rateit.js"></script>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/easypaginate.js"></script>

        <script>            
            $j(".rich-table-row:odd").addClass("odd");
        </script>
        <script type="text/javascript" language="javascript">
            var open_cur = 0;
            $j = jQuery.noConflict();
            $j(document).ready(function(){
                
                $j('.contactN950').live('click',function(){
                    object = $j(this).next();
                    var pn100KH = $j('#formKHCN\\:pn100').val();
                    $j(".mesage").text("");
                    $j.post("contactCRM.jsp?action=editajaxpage&pn100="+ pn100KH+"&table=N100", function(data){
                        $j('.customer-boxcontact').html(data);
                    });
                    
                });
                $j('.acountT025').live('click',function(){
                    $j(".mesage").text("");
                    object = $j(this).next();
                    var pn100KH = $j('#formKHCN\\:pn100').val();         
                    $j.post("accountCRM.jsp?action=editajaxpage&pn100="+pn100KH+"&tv026=N100",function(data){
                        $j('.customer-boxacount').html(data);
                    }) ;
                    
                });
                
                $j('.customerK100').live('click',function(){
                    $j(".mesage").text("");
                    object = $j(this).next();
                    var pn100KH = $j('#formKHCN\\:pn100').val();  
                    $j.post("customerdemo.jsp?action=editEmp&pn100="+ pn100KH+"&table=formload&pt025=1&itemid=N100", function(data){
                        $j('.customer-boxcustomer').html(data);
                    });
                    
                });
                
                $j('.infoN350').live('click',function(){
                    $j(".mesage").text("");
                    object = $j(this).next();
                    var pn100KH = $j('#formKHCN\\:pn100').val(); 
                    $j.post("passportCRM.jsp?action=editajaxpage&pn100="+ pn100KH, function(data){
                        $j('.customer-boxN350').html(data);
                    });
                    
                });
                $j('.companyCRM').live('click',function(){
                    object = $j(this).next();
                    var pn100KH = $j('#formKHCN\\:pn100').val();   
                    $j.post("companyCRM.jsp?action=editajaxpage&pn100="+ pn100KH, function(data){
                        $j('.customer-companyCRM').html(data);
                    }) ;
                    
                }); 
              
                $j('.addTour1').live('click',function(){
                    //  alert($j(this).parent().attr('class'));
                    // alert($j(this).parent().parent().parent().attr('class'));
                    $j(this).parent().parent().parent().css("display","none");
                    
                    $j(".popup-content").css("display","block");
                    
                });
                $j('.returnFind').live("click",function(){
                    $j(this).parent().parent().parent().css("display","none");
                    $j(".formfrist").css("display","block");
                });
                
                // chọn người đại diện vào Tuor
                $j(".checkTour").live("change",function(){  
                    
                    if($j(this).is(':checked')){ 
                        pn100 = $j(this).attr("lang");  
                        fv050 = $j('#fromSearchDD\\:FV0500').val();
                       // alert(fv050);
                        showPleaseWait();
                        $j.post("actionpersonalForTour.jsp?action=addpersonalforTour&pn100="+pn100+"&fv050="+fv050,function(data){
                            if(data > 0){
                                $j(".mesage123").text("Cập nhật thành công !");
                                hidePleaseWait();
                            }else if(data == 0){
                                $j(".mesage123").text("Cập nhật thành công !");
                                hidePleaseWait();
                            }
                        });
                    
                    }
    
                });
                
                $j('.check_select').live('click',function(){
                    var lang= $j(this).attr("lang");
                    fk100 = $j(this).parent().attr("lang");
                    var boool;
                    //alert(lang)               
                    if( $j(this).is(":checked"))
                    {
                        boool = true;
                    }
                    else
                    {
                        boool = false;
                    }
                            
                    $j.post("listEmployee.jsp?action=addnotcheckAll&fk100CTT="+fk100+"&pn100="+lang+"&boolNV="+boool+"&typecheck=NV",function(data){
                            
                    });
                });
                
                $j(".checkAll").live("click",function(){
                    //alert('check all');
                    flag = $j('.checkAll').is(':checked');
                    fk100 = $j(this).parent().parent().prev().parent().parent().next().children().children().next().children().attr('lang');
                    //    alert(fk100);
                    $j(".check_select").each(function(){
                        $j('.check_select')  .attr('checked', flag);
                    });
                        
                    var boool;
                    if( $j(this).is(":checked"))
                    {
                        boool = true;
                    }
                    else
                    {
                        boool = false;
                    }
                    $j.post("listEmployee.jsp?action=addcheckAll&fk100CTT="+fk100+"&boolNV="+boool+"&typecheck=NV",function(data){
                            
                    });
                    //                    $j.post("workChargeCM.jsp?action=addAllCusp100&boool="+boool+"&kh=CM",function(data){
                    //                            
                    //                    });

                });
            });
        </script>
        <style type="text/css">
            .customer-box{
                float:left; width:604px; margin-left:25px;
                border:1px solid #CCCCCC;
                padding:18px 0px 10px 0px;
                background: #E5E8EA;
                border-top: none;

            }
            .customer-box{
                float:left; width:604px; margin-left:25px;
                border:1px solid #CCCCCC;
                padding:18px 0px 10px 0px;
                background: #E5E8EA;
                border-top: none;

            }
            .customer-box label{
                width:90px;
                text-align: right;
                float:left;
            }
            input{
                float:left;
                margin-left:9px;
            }
            select{
                float:left;
                height: 21px;
                width:166px;
                margin-left:9px;
            }
            .ui-datepicker-header select{
                width:45% !important;
            }
            .header-box{
                margin-left:25px;
                color:#263340;
                margin-top:10px;
                float: left;
                cursor:pointer;
                padding:4px 0px 0px 4px; 
                width:600px;
                border:1px solid #CCCCCC;
                font-size:12px;
                background: #D4D7D8;
                height: 21px;
                font-weight: bold;
            }
            .fixdate .ui-datepicker-trigger  { margin-left: 4px;}

            .mesage123{
                color: red;
                float: left;
                margin-left: 252px;
                margin-top: 20px;
                text-transform: uppercase;

            }
            .smsContent{
                float: left;
                margin: 10px;               
                width: 98%;

            }
            .rich-table-subheadercell {
                background-color: #2ba8e9;
            }
            .titleDDDD{
                color: #7F9FBE;
                float: left;
                font-size: 12px;
                height: 20px;
                line-height: 20px;
                margin-top: 3px;
                padding-left: 13px;
                width: 100%;

            }
            .titleDDDD a{
                color:#0055A6 !important;
                font-weight:bold;
            }
            .titleDDDD a img{
                margin-top: 4px;
            }
            .buttonsearch12 {
                background: url("../images/btn_search.png") no-repeat scroll 7px 4px white;
                border: 0 none;
                color: #FFFFFF;
                cursor: pointer;
                float: left;
                height: 20px;
                margin-left: 682px;
                margin-top: 1px;
                position: absolute;
                text-transform: uppercase;
                width: 28px;}
            .addTour1{
                background: url("../images/icon_addTour.png") repeat scroll 0 0 transparent;
                border-radius: 3px 3px 3px 3px;
                float: left;
                height: 22px;
                margin-left: 10px;
                margin-right: -140px;
                margin-top: 0;
                position: relative;
                width: 27px;
            }
            .formsearch{
                float: left;
            }
        </style>

    </head>

    <f:view>
        <body>
            <f:loadBundle basename="#{environmentSession.localizationSource}" var="locale"/>  
            <div class="titleDDDD">
                <h:outputLink  rendered="#{loginSession.right.COM_EMP_CRE}"    value="employeePersonalDD.jsp?action=addpersonalDDforTour&page=listTour&step=111&FV050=#{v020Controller.fv050}&height=250px&width=400px" styleClass="fancybox">
                    <img src="../images/add_tab.png" alt="add" title="add" /> Thêm người đại diện
                </h:outputLink>

                <h:inputHidden value="#{v020Controller.fv050}" id="fv050"/>
            </div>
            <div class="smsContent">                                                         
                <rich:dataTable  value="#{v020Controller.listAllV020}" rowKeyVar="row" var="item" columnClasses="col1"
                                 rowClasses="blue, white"
                                 id="abcxyz" width="100%">
                    <rich:column width="3%"> 
                        <f:facet name="header">
                            <h:outputText value="STT"/>
                        </f:facet>
                        <div style="width: 100%; text-align: center">
                            <h:outputText value="#{row +1}"/>
                        </div>                        
                    </rich:column> 
                    <rich:column width="10%"> 
                        <f:facet name="header">
                            <h:outputText value="Action"/>
                        </f:facet>
                        <div style="width: 100%; text-align: center">
                            <h:outputLink value="editcodeproductTour.jsp?id=&action=editforTour&page=listTour.jsp&SV216=0&height=310px&width=405px" styleClass="fancybox" id="fancybox1" >
                                <img style="padding-right:4px;" src="../images/edit.png" alt="Sửa" title="Sửa" />
                            </h:outputLink>
                            <h:outputLink value="delete.jsp?flag=V020&id=#{item.PV020}&id2=#{v020Controller.fv050}&page=listTour.jsp&width=300&height=150" styleClass="fancybox add_new" id="thickbox2"  style="cursor:pointer" >
                                <img style="padding-right:4px;" src="../images/delete_1.png" alt="Xóa"  title="Xóa" />
                            </h:outputLink>
                        </div>                        
                    </rich:column>
                    <rich:column width="3%"> 
                        <f:facet name="header">
                            <h:selectBooleanCheckbox value=""/>
                        </f:facet>
                        <div style="width: 100%;  margin-left: 4px;text-align: center">
                            <h:selectBooleanCheckbox value=""/>
                        </div>                        
                    </rich:column>  
                    <rich:column  width="20%"> 
                        <f:facet name="header">
                            <h:outputText value="Họ tên" styleClass="col1" />
                        </f:facet>
                        <div style="width: 100%">
                            <h:outputLink value="customer.jsp?action=linkCus&pnPN100=#{item.pn100}&type=#{item.nn114}"> <h:outputText value="#{item.hoten}"/></h:outputLink>
                        </div>
                    </rich:column>                                 
                    <rich:column width="10%">
                        <f:facet name="header">
                            <h:outputText value="Số DT"/>
                        </f:facet>
                        <div style="width: 100%;text-align: center">
                            <h:outputText value="#{item.phone}"/>
                        </div>
                    </rich:column> 
                    <rich:column width="20%">
                        <f:facet name="header">
                            <h:outputText value="Email"/>
                        </f:facet>
                        <div style="width: 100%;">
                            <h:outputText value="#{item.email}"/>
                        </div>
                    </rich:column> 
                    <rich:column width="30%">
                        <f:facet name="header">
                            <h:outputText value="Địa chỉ"/>
                        </f:facet>
                        <div style="width: 100%;">
                            <h:outputText value="#{item.nv112}"/>
                        </div>
                    </rich:column> 
                    <%--  <rich:column style="width:35px;">
                          <f:facet name="header">
                              <h:outputText value="" />
                          </f:facet>
                          <div class="row6" style="display:<h:outputText value="#{B630Bean.displaycus}"/>">
                              <h:outputLink  rendered="#{loginSession.right.CUS_CMA_MOD}"  value="noteWorkChargeInput.jsp?action=editB650&page=workChargeCM.jsp&pb650=#{item.pb650}&pb630=#{B630Bean.pb630}&title=#{B630Bean.title}&height=300px&width=500px" styleClass="fancybox">
                                  <img src="../images/edit.png" alt="edit" title="edit"/>
                              </h:outputLink>
                              <h:outputLink  rendered="#{loginSession.right.CUS_CMA_DEL}"  value="delete.jsp?id=#{item.pb650}&id2=#{B630Bean.pb630}&flag=B650&page=workChargeCM.jsp?&height=150px&width=300px" styleClass="fancybox">
                                  <img src="../images/delete_1.png" alt="delete"  title="delete" />
                              </h:outputLink>
                          </div>

                    </rich:column> --%>

                </rich:dataTable>
            </div>

            <%--      <a4j:repeat value="#{viewBean.listM300US}" var="item" >  
                      <div class="rich-table-row rich-table-firstrow cssHeight">
                          <div class="rich-table-cell cssLeft borderLft " style="width: 108px"><h:outputText value="#{item.hoten}" /></div>
                          <div class="rich-table-cell cssLeft" style="width: 148px"><h:outputText value="#{item.mv304}" /></div>
                          
                      </div>

                </a4j:repeat> --%>

        </body>
    </f:view>
</html>
